/**
 * @description 交易对手基础信息
 * @author chenyan
 */

import React, { PropTypes, PureComponent } from 'react';
import Counterparties from '../../counterpartyManagement/counterpartyInformation/counterparties';

class CounterpartyInfoDetailC extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      businessKey: undefined, //流程id
      timeStamp: undefined, //时间戳
    };
  }

  componentDidMount() {
    this.setState({
      businessKey: this.props.businessKey,
      timeStamp: this.props.timeStamp,
    });
  }

  UNSAFE_componentWillReceiveProps(nextProps) {
    if (this.state.timeStamp && this.state.timeStamp !== nextProps.timeStamp) {
      this.setState({
        businessKey: nextProps.businessKey,
        timeStamp: nextProps.timeStamp,
      });
    }
  }
  render() {
    return <Counterparties type='query' id={this.props.businessKey} timeStamp={this.state.timeStamp} />;
  }
}

export default CounterpartyInfoDetailC;
